<?php
	$type = ( isset($_REQUEST['type']) ? $_REQUEST['type'] : '' ) ;
	
	switch ($type) {
		case ACCOUNT_CHECK_TYPE_NAME;
			$account_name = ( isset($_REQUEST['account_name']) ? $_REQUEST['account_name'] : '' ) ;
			if ( isAccountNameExists($account_name) ){
				echo true;
			}
			else {
				$_SESSION['error_register'] = '';
				echo false;
			}
		break;
		case ACCOUNT_CHECK_TYPE_EMAIL;
			$account_email = ( isset($_REQUEST['account_email']) ? $_REQUEST['account_email'] : '' ) ;
			if ( isAccountEmailExists($account_email) ){
				echo true;
			}
			else {
				$_SESSION['error_register'] = '';
				echo false;
			}
		break;
	}
?>